package 创建数组;

public class demo5_数组最小值4 {
    public static void main(String[] args) {
    	int a[] = new int[5];
        a[0] = (int) (Math.random() * 100);
        a[1] = (int) (Math.random() * 100);
        a[2] = (int) (Math.random() * 100);
        a[3] = (int) (Math.random() * 100);
        a[4] = (int) (Math.random() * 100);
         
        System.out.println("数组中的各个随机数是:");
         
        for (int i = 0; i < a.length; i++)
        {
            System.out.print(a[i]+" ");
        }
         
        for(int i=0; i<5; i++)
        {
            if(a[0]>a[i])
            {
                a[0] = a[i];
            }
        }
        System.out.println("\n"+a[0]);
    }
}